import { createRouter, createWebHistory} from 'vue-router';
// 组件导入
import Layout from '@/views/layout/index.vue'
import CategoryView from '@/views/category/index.vue'
import UserView from '@/views/user/index.vue'
import LoginView from '@/views/user/login.vue'
import IndexView from '@/views/index/index.vue'
import ServiceView from '@/views/serve/index.vue'




const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes:[
    {
      path:'/',
      name:'layout',
      component:Layout,
      children:[
        {path:'/',redirect:'/index'},
        {path:'/index',name:'index',component:IndexView},
        {path:'/page',name:'page',component:UserView},
        {path:'/category',name:'category',component:CategoryView},
        {path:'/serve/project',name:'serve',component:ServiceView}
      ]
    },{path:'/login',name:'login',component:LoginView}  

  ]
  
});

export default router;